<div class="layui-card">
    <div class="layui-card-body ">
        <form action="{:url('admin/system.asset/delasset')}" method="post" class="layui-form delete-form" id="cp-form">
            <div class="layui-btn-group">
                <button data-url="{:url('admin/system.asset/delasset')}" class="layui-btn layui-btn-xs layui-btn-danger clearExceptionNode">
                    <i class="layui-icon">&#xe640;</i>
                    删除
                </button>
            </div>
            <table class="layui-table">
                <thead>
                <tr>
                    <th width="10">
                        <input type="checkbox" class="layui-input"  lay-skin="primary" lay-filter="select-all">
                    </th>
                    <!--<th width="50">ID</th>-->
                    <th>用户</th>
                    <th width="100">文件大小</th>
                    <th>文件名</th>
                    <th width="40">图像</th>
                    <th>文件路径</th>
                    <th>状态</th>
                    <th width="160">操作</th>
                </tr>
                </thead>
                <tbody>
                <?php
                    $asset_img_suffixes=['bmp','jpg','jpeg','png','gif','tiff'];/*TODO ADD MORE*/
                    $status=['不可用', '可用'];
                ?>
                {volist name="dataList" id='vo'}
                <tr>
                    <td align="center" valign="middle">
                        <input type="checkbox" name="idList[]" class="layui-input" lay-skin="primary" value="{$vo.id}">
                    </td>
                    <!--<td>{$vo.id}</td>-->
                    <td>
                        用户ID:{$vo.user_id} {$vo.username} {$vo.user_nickname}
                    </td>
                    <td>{$vo.file_size/1024|round}KB</td>
                    <td>{$vo.filename}</td>
                    <td>
                        {if condition="in_array(strtolower($vo['suffix']),$asset_img_suffixes)"}
                            <a href="javascript:imagePreviewDialog('{:_get_image_preview_url($vo['file_path'])}');">
                                <i class="layui-icon layui-icon-picture-fine"></i>
                            </a>
                        {/if}
                    </td>
                    <td>
                        {$vo.file_path}
                        {if condition="!file_exists( dirname(app_path()).'/public/upload/'.$vo['file_path'])"}
                            <span style='color:red;'>&nbsp;&nbsp(文件丢失)</span>
                        {/if}
                    </td>
                    <td>{$status[$vo['status']]}</td>
                    <td  valign="middle">
                        {if condition="in_array(strtolower($vo['suffix']),$asset_img_suffixes)"}
                        <a href="javascript:compressImg('{:url('admin/system.asset/compressImg',['img_id'=>$vo['id']])}');" class="layui-btn layui-btn-xs">开始压缩</a>
                        {/if}
                    </td>
                </tr>
                {/volist}
                </tbody>
            </table>
            {$dataList|raw}
        </form>
    </div>
</div>